#ifndef WF_MODIFYROUND_H
#define WF_MODIFYROUND_H

#include "pf_previewactioninterface.h"
#include "pf_modification.h"
#include "gui_export.h"

/**
 * This action class can handle user events to round corners.
 *
 */
class GUI_EXPORT WF_ModifyRound : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetEntity1,         /**< Choosing the 1st entity. */
        SetEntity2,         /**< Choosing the 2nd entity. */
		SetRadius,          /**< Setting radius in command line. */
		SetTrim             /**< Setting trim flag in command line. */
    };

public:
    WF_ModifyRound(PF_Container& container,
                        PF_GraphicView& graphicView);
    ~WF_ModifyRound() {}

	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);
	
	virtual LX_Define::ActionType rtti() {
		return LX_Define::ActionModifyRound;
	}

    virtual void init(int status=0);
    virtual void trigger();

    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
	
    virtual void commandEvent(PF_CommandEvent* e);
	virtual PF_StringList getAvailableCommands();
	
    virtual void hideOptions();
    virtual void showOptions();
	
    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();
	
	void setRadius(double r) {
		data.radius = r;
	}

	double getRadius() {
		return data.radius;
	}

	void setTrim(bool t) {
		data.trim = t;
	}

	bool isTrimOn() {
		return data.trim;
	}

private:
	//PF_Vector coord;
	PF_Vector coord1;
    PF_Entity* entity1;
	PF_Vector coord2;
    PF_Entity* entity2;
	PF_RoundAttribute data;
	/** Last status before entering angle. */
	Status lastStatus;
};

#endif
